﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="SubjectGroupLocationDomainService.cs" company="ELEN 7045 GROUP II">
//    Contributed by E.Vosloo
// </copyright>
// <summary>
//   ISubjectGroupDomainService Implementation. Provides a place to manage business rules.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace Domain.StudyDefinition.Services
{
    #region

    using Domain.Setup.Entities;
    using Domain.StudyDefinition.Contracts.DomainServices;
    using Domain.StudyDefinition.Entities;

    #endregion

    /// <summary>
    /// ISubjectGroupDomainService Domain Service Implementation
    /// </summary>
    public class SubjectGroupLocationDomainService : ISubjectGroupLocationDomainService
    {
        #region Implemented Interfaces

        #region ISubjectGroupLocationDomainService

        /// <summary>
        /// Moves the subject group to new location after checking if rules are satisfied.
        /// </summary>
        /// <param name="subjectGroup">
        /// The subject group.
        /// </param>
        /// <param name="newLocation">
        /// The new location.
        /// </param>
        public void MoveSubjectGroupToNewLocation(SubjectGroup subjectGroup, Location newLocation)
        {
            /*This provides me with a place to implement domain rules.
             One such rule associated with the transfer time between two locations.
            
             If the transfer time between two locations is too long a business rule 
             * could prevent the subject group move from taking place
             */

            /* Begin Implement Rules Here
             * 
             * simple example: 
             * IF subjectGroup.AllowedTransitTime > RULE
             * throw BROKEN RULE EXCEPTION
             * 
            End Implement Rules */

            // subjectGroup.OccupiedLocation = newLocation;
        }

        #endregion

        #endregion
    }
}